<?php
/*
	插件概览
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'statistics';
if($_RQ['op']=='statistics'){
	//显示统计数据
		  // 建站到开始时间冻结金额 freeze_where():返回冻结的查询条件
		pdo_delete('jy_jdpm_notice_log',array('uniacid'=>0));
		pdo_delete('jy_jdpm_money_log',array('uniacid'=>0));
		$member=get_member($_SESSION['uid']);
		$credit2sum = pdo_getsum('core_members',array('uniacid'=>$_SESSION['uniacid']),'credit2');
        $walletsum['wallet_pledge_freeze'] = pdo_getsum('jy_jdpm_member',array('uniacid'=>$_SESSION['uniacid']),'wallet_pledge_freeze');
		$pledge = pdo_getsum('jy_jdpm_member_pledge_bill',array('uniacid'=>$_SESSION['uniacid'],'changetype'=>array('bid_freeze','admin_freeze','extract_freeze','add_freeze')),'balance');
		$limsum = pdo_getsum('jy_jdpm_member_limsum_bill',array('uniacid'=>$_SESSION['uniacid'],'changetype'=>array('bid_freeze','admin_freeze','extract_freeze','add_freeze')),'balance');
		// 建站到开始时间解冻金额 unfreeze_where():返回解冻的查询条件
		$pledge_where_unfreeze = pdo_getsum('jy_jdpm_member_pledge_bill',array('uniacid'=>$_SESSION['uniacid'],'changetype'=>array('bid_freeze','admin_freeze','extract_freeze','add_freeze','payadd_unfreeze')),'usable');
		$limsum_where_unfreeze = pdo_getsum('jy_jdpm_member_limsum_bill',array('uniacid'=>$_SESSION['uniacid'],'changetype'=>array('bid_freeze','admin_freeze','extract_freeze','add_freeze','payadd_unfreeze')),'usable');
        // 建站到开始时间扣除的金额 reduce_where():返回扣除的查询条件
		$pledge_where_reduce = pdo_getsum('jy_jdpm_member_pledge_bill',array('uniacid'=>$_SESSION['uniacid'],'changetype'=>array('admin_deduct','pay_deduct')),'expend');
		$limsum_where_reduce = pdo_getsum('jy_jdpm_member_limsum_bill',array('uniacid'=>$_SESSION['uniacid'],'changetype'=>array('admin_deduct','pay_deduct')),'expend');
        // 建站到开始时间增加的金额 increase_where():返回增加的查询条件
		$pledge_where_increase = pdo_getsum('jy_jdpm_member_pledge_bill',array('uniacid'=>$_SESSION['uniacid'],'changetype'=>array('admin_deposit','pay_deposit','card_deposit','share_add','reward_add','profit','return','seller_break_nopay','buy_break_deliver')),'income');
        $limsum_where_increase = pdo_getsum('jy_jdpm_member_limsum_bill',array('uniacid'=>$_SESSION['uniacid'],'changetype'=>array('admin_deposit','pay_deposit','card_deposit','share_add','reward_add','profit','return','seller_break_nopay','buy_break_deliver')),'income');
        // 建站到开始时间扣除冻结的金额 increase_freeze_where():返回扣除冻结的查询条件
        $pledgeif = pdo_fetch('select SUM(expend) as expend from '. tablename('jy_jdpm_member_pledge_bill').' where changetype = "extract" and uniacid='.$_SESSION['uniacid']);
        $pledge_where_increase = $pledgeif['expend'];       
		$limsumif = pdo_fetch('select SUM(expend) as expend from '. tablename('jy_jdpm_member_limsum_bill').' where changetype = "extract" and uniacid='.$_SESSION['uniacid']);
        $pledge_where_increase = $limsumif['expend']; 
		 // 查询条件余额
        $walletsum['wallet_pledge_where'] = ($pledge_where_increase-$pledge_where_reduce)-$pledge_where_increase_freeze;
        // 冻结余额
        $walletsum['wallet_pledge_where_freeze'] = $pledge_where_freeze-$pledge_where_unfreeze-$pledge_where_increase_freeze;
        // 查询条件内可用余额
        $walletsum['wallet_pledge_where_usable'] = $walletsum['wallet_pledge_where']-$walletsum['wallet_pledge_where_freeze'];

        // 查询条件信誉
        $walletsum['wallet_limsum_where'] = ($limsum_where_increase-$limsum_where_reduce)-$limsum_where_increase_freeze;
        // 冻结信誉
        $walletsum['wallet_limsum_where_freeze'] = $limsum_where_freeze-$limsum_where_unfreeze-$limsum_where_increase_freeze;
        // 查询条件内可用信誉
        $walletsum['wallet_limsum_where_usable'] = $walletsum['wallet_limsum_where']-$walletsum['wallet_limsum_where_freeze'];
// 余额	
		// 可用余额
        $walletsum['wallet_pledge_usable'] = $credit2sum-$walletsum['wallet_pledge_freeze'];
        // 可用信誉
        $walletsum['wallet_limsum_usable'] = $walletsum['wallet_limsum']-$walletsum['wallet_limsum_freeze'];

        // 拍卖冻结
        $wallet_pledge_bid_expend = pdo_fetch('select SUM(expend) as expend from '. tablename('jy_jdpm_member_pledge_bill').' where changetype = "bid_freeze" and uniacid='.$_SESSION['uniacid']);
		$walletsum['wallet_pledge_bid_expend'] = $wallet_pledge_bid_expend['expend'];
		// 发布拍卖冻结
        $wallet_pledge_add_expend = pdo_fetch('select SUM(expend) as expend from '. tablename('jy_jdpm_member_pledge_bill').' where changetype = "add_freeze" and uniacid='.$_SESSION['uniacid']);
		$walletsum['wallet_pledge_add_expend'] = $wallet_pledge_add_expend['expend'];
		// 管理员冻结
        $wallet_pledge_admin_freeze = pdo_fetch('select SUM(expend) as expend from '. tablename('jy_jdpm_member_pledge_bill').' where changetype = "admin_freeze" and  uniacid='.$_SESSION['uniacid']);
		$walletsum['wallet_pledge_admin_freeze'] = $wallet_pledge_admin_freeze['expend'];
		// 提现冻结
        $wallet_pledge_take_freeze = pdo_fetch('select SUM(expend) as expend from '. tablename('jy_jdpm_member_pledge_bill').' where changetype = "extract_freeze" and  uniacid='.$_SESSION['uniacid']);
		$walletsum['wallet_pledge_take_freeze'] = $wallet_pledge_take_freeze['expend'];
        // 拍卖解冻
        $wallet_pledge_bid_income = pdo_fetch('select SUM(income) as income from '. tablename('jy_jdpm_member_pledge_bill').' where changetype = "bid_unfreeze" and  uniacid='.$_SESSION['uniacid']);
		$walletsum['wallet_pledge_bid_income'] = $wallet_pledge_bid_income['income'];
		// 交易成功解冻
		$wallet_pledge_add_income = pdo_fetch('select SUM(income) as income from '. tablename('jy_jdpm_member_pledge_bill').' where changetype = "add_unfreeze" and  uniacid='.$_SESSION['uniacid']);
		$walletsum['wallet_pledge_add_income'] = $wallet_pledge_add_income['income'];
		// 管理员解冻
		$wallet_pledge_admin_unfreeze = pdo_fetch('select SUM(income) as income from '. tablename('jy_jdpm_member_pledge_bill').' where changetype = "admin_unfreeze" and  uniacid='.$_SESSION['uniacid']);
		$walletsum['wallet_pledge_admin_unfreeze'] = $wallet_pledge_admin_unfreeze['income'];
        // 卖家未按时发货扣除
        $wallet_pledge_seller_break_deliver = pdo_fetch('select SUM(expend) as expend from '. tablename('jy_jdpm_member_pledge_bill').' where changetype = "seller_break_deliver" and  uniacid='.$_SESSION['uniacid']);
		$walletsum['wallet_pledge_seller_break_deliver'] = $wallet_pledge_seller_break_deliver['expend'];
		// 订单过期扣除
        $wallet_pledge_buy_break_nopay = pdo_fetch('select SUM(expend) as expend from '. tablename('jy_jdpm_member_pledge_bill').' where changetype = "buy_break_nopay" and  uniacid='.$_SESSION['uniacid']);
		$walletsum['wallet_pledge_buy_break_nopay'] = $wallet_pledge_buy_break_nopay['expend'];
        // 保证金抵货款
        $wallet_pledge_paypledge_expend = pdo_fetch('select SUM(expend) as expend from '. tablename('jy_jdpm_member_pledge_bill').' where changetype = "pay_pledge" and  uniacid='.$_SESSION['uniacid']);
		$walletsum['wallet_pledge_paypledge_expend'] = $wallet_pledge_paypledge_expend['expend'];
		// 支付扣除
        $wallet_pledge_pay_expend = pdo_fetch('select SUM(expend) as expend from '. tablename('jy_jdpm_member_pledge_bill').' where changetype = "pay_deduct" and  uniacid='.$_SESSION['uniacid']);
		$walletsum['wallet_pledge_pay_expend'] = $wallet_pledge_pay_expend['expend'];
		// 管理员扣除余额
        $wallet_pledge_admin_expend = pdo_fetch('select SUM(expend) as expend from '. tablename('jy_jdpm_member_pledge_bill').' where changetype = "admin_deduct" and  uniacid='.$_SESSION['uniacid']);
		$walletsum['wallet_pledge_admin_expend'] = $wallet_pledge_admin_expend['expend'];
		// 提现扣除
        $wallet_pledge_take = pdo_fetch('select SUM(expend) as expend from '. tablename('jy_jdpm_member_pledge_bill').' where changetype = "extract" and  uniacid='.$_SESSION['uniacid']);
		$walletsum['wallet_pledge_take'] = $wallet_pledge_take['expend'];
        // 卖家未按时发货收入
        $wallet_pledge_buy_break_deliver = pdo_fetch('select SUM(income) as expend from '. tablename('jy_jdpm_member_pledge_bill').' where changetype = "buy_break_deliver" and  uniacid='.$_SESSION['uniacid']);
		$walletsum['wallet_pledge_buy_break_deliver'] = $wallet_pledge_buy_break_deliver['income'];
		// 订单过期收入
        $wallet_pledge_seller_break_nopay = pdo_fetch('select SUM(income) as expend from '. tablename('jy_jdpm_member_pledge_bill').' where changetype = "seller_break_nopay" and  uniacid='.$_SESSION['uniacid']);
		$walletsum['wallet_pledge_seller_break_nopay'] = $wallet_pledge_seller_break_nopay['income'];
        // 在线充值
        $wallet_pledge_inlin_income = pdo_fetch('select SUM(income) as expend from '. tablename('jy_jdpm_member_pledge_bill').' where changetype = "pay_deposit" and  uniacid='.$_SESSION['uniacid']);
		$walletsum['wallet_pledge_inlin_income'] = $wallet_pledge_inlin_income['income'];
		// 充值卡充值
        $wallet_pledge_card_income = pdo_fetch('select SUM(income) as expend from '. tablename('jy_jdpm_member_pledge_bill').' where changetype = "card_deposit" and  uniacid='.$_SESSION['uniacid']);
		$walletsum['wallet_pledge_card_income'] = $wallet_pledge_card_income['income'];
		// 管理员充值余额
        $wallet_pledge_admin_income = pdo_fetch('select SUM(income) as expend from '. tablename('jy_jdpm_member_pledge_bill').' where changetype = "admin_deposit" and  uniacid='.$_SESSION['uniacid']);
		$walletsum['wallet_pledge_admin_income'] = $wallet_pledge_admin_income['income'];
		// 分享奖励
        // $walletsum['wallet_pledge_share_income'] = $wallet_bill->where($where)->where(array('changetype'=>'share_add'))->sum('income');
        // 交易收入
        $wallet_pledge_profit_income = pdo_fetch('select SUM(income) as expend from '. tablename('jy_jdpm_member_pledge_bill').' where changetype = "profit" and  uniacid='.$_SESSION['uniacid']);
		$walletsum['wallet_pledge_profit_income'] = $wallet_pledge_profit_income['income'];
// 信誉额度
        // 拍卖冻结
        $wallet_limsum_bid_expend = pdo_fetch('select SUM(expend) as expend from '. tablename('jy_jdpm_member_limsum_bill').' where changetype = "bid_freeze" and  uniacid='.$_SESSION['uniacid']);
        $walletsum['wallet_limsum_bid_expend'] = $wallet_limsum_bid_expend['expend'];
		// 发布拍卖冻结
        $wallet_limsum_add_expend = pdo_fetch('select SUM(expend) as expend from '. tablename('jy_jdpm_member_limsum_bill').' where changetype = "add_freeze" and  uniacid='.$_SESSION['uniacid']);
        $walletsum['wallet_limsum_add_expend'] = $wallet_limsum_add_expend['expend'];
		// 管理员冻结
        $wallet_limsum_admin_freeze = pdo_fetch('select SUM(expend) as expend from '. tablename('jy_jdpm_member_limsum_bill').' where changetype = "admin_freeze" and  uniacid='.$_SESSION['uniacid']);
        $walletsum['wallet_limsum_admin_freeze'] = $wallet_limsum_admin_freeze['expend'];
		// 提现冻结
        $wallet_limsum_take_freeze = pdo_fetch('select SUM(expend) as expend from '. tablename('jy_jdpm_member_limsum_bill').' where changetype = "extract_freeze" and  uniacid='.$_SESSION['uniacid']);
        $walletsum['wallet_limsum_take_freeze'] = $wallet_limsum_take_freeze['expend'];
        // 拍卖解冻
        $wallet_limsum_bid_income = pdo_fetch('select SUM(income) as income from '. tablename('jy_jdpm_member_limsum_bill').' where changetype = "bid_unfreeze"');
        $walletsum['wallet_limsum_bid_income'] = $wallet_limsum_bid_income['income'];
		// 交易成功解冻
        $wallet_limsum_add_income = pdo_fetch('select SUM(income) as income from '. tablename('jy_jdpm_member_limsum_bill').' where changetype = "add_unfreeze" and uniacid='.$_SESSION['uniacid']);
        $walletsum['wallet_limsum_add_income'] = $wallet_limsum_add_income['income'];

        // 卖家未按时发货收入
        $wallet_limsum_buy_break_deliver = pdo_fetch('select SUM(income) as income from '. tablename('jy_jdpm_member_limsum_bill').' where changetype = "buy_break_deliver" and uniacid='.$_SESSION['uniacid']);
        $walletsum['wallet_limsum_buy_break_deliver'] = $wallet_limsum_buy_break_deliver['income'];
		// 订单过期收入
        $wallet_limsum_seller_break_nopay = pdo_fetch('select SUM(income) as income from '. tablename('jy_jdpm_member_limsum_bill').' where changetype = "seller_break_nopay" and uniacid='.$_SESSION['uniacid']);
        $walletsum['wallet_limsum_seller_break_nopay'] = $wallet_limsum_seller_break_nopay['income'];
        // 卖家未按时发货扣除
        $wallet_limsum_seller_break_deliver = pdo_fetch('select SUM(expend) as expend from '. tablename('jy_jdpm_member_limsum_bill').' where changetype = "seller_break_deliver" and uniacid='.$_SESSION['uniacid']);
        $walletsum['wallet_limsum_seller_break_deliver'] = $wallet_limsum_seller_break_deliver['expend'];
		// 订单过期扣除
        $wallet_limsum_buy_break_nopay = pdo_fetch('select SUM(expend) as expend from '. tablename('jy_jdpm_member_limsum_bill').' where changetype = "buy_break_nopay"  and uniacid='.$_SESSION['uniacid']);
        $walletsum['wallet_limsum_buy_break_nopay'] = $wallet_limsum_buy_break_nopay['expend'];
        // 管理员解冻
        $wallet_limsum_admin_unfreeze = pdo_fetch('select SUM(expend) as expend from '. tablename('jy_jdpm_member_limsum_bill').' where changetype = "admin_unfreeze" and uniacid='.$_SESSION['uniacid']);
        $walletsum['wallet_limsum_admin_unfreeze'] = $wallet_limsum_admin_unfreeze['expend'];
        // 管理员扣除余额
        $wallet_limsum_admin_expend = pdo_fetch('select SUM(expend) as expend from '. tablename('jy_jdpm_member_limsum_bill').' where changetype = "admin_deduct" and uniacid='.$_SESSION['uniacid']);
        $walletsum['wallet_limsum_admin_expend'] = $wallet_limsum_admin_expend['expend'];
		// 充值卡充值
        $wallet_limsum_card_income = pdo_fetch('select SUM(income) as income from '. tablename('jy_jdpm_member_limsum_bill').' where changetype = "card_deposit" and uniacid='.$_SESSION['uniacid']);
        $walletsum['wallet_limsum_card_income'] = $wallet_limsum_card_income['income'];
		// 管理员充值余额
        $wallet_limsum_admin_income = pdo_fetch('select SUM(income) as income from '. tablename('jy_jdpm_member_limsum_bill').' where changetype = "admin_deposit" and uniacid='.$_SESSION['uniacid']);
        $walletsum['wallet_limsum_admin_income'] = $wallet_limsum_admin_income['income'];
		// 分享奖励
        $wallet_limsum_share_income = pdo_fetch('select SUM(income) as income from '. tablename('jy_jdpm_member_limsum_bill').' where changetype = "share_add" and uniacid='.$_SESSION['uniacid']);
        $walletsum['wallet_limsum_share_income'] = $wallet_limsum_share_income['income'];
		// 推广建立
        $wallet_limsum_reward_income = pdo_fetch('select SUM(income) as income from '. tablename('jy_jdpm_member_limsum_bill').' where changetype = "reward_add" and uniacid='.$_SESSION['uniacid']);
        $walletsum['wallet_limsum_reward_income'] = $wallet_limsum_reward_income['income'];
		
// 卖家佣金
        $broker_where = pdo_fetch('select SUM(broker) as broker from '. tablename('jy_jdpm_order').' where status in  ("3","10") and uniacid='.$_SESSION['uniacid']);
        $walletsum['broker'] = $broker_where['broker'];
		$broker_where_predict = pdo_fetch('select SUM(broker) as broker from '. tablename('jy_jdpm_order').' where status in  ("0","1","2") and uniacid='.$_SESSION['uniacid']);
        $walletsum['broker_predict'] = $broker_where_predict['broker'];
// 买家手续费
        //$walletsum['broker_buy_where'] = $jy_jdpm_order->where($bkwhere)->where(array('status'=>array('in',array(3,10))))->sum('broker_buy');
        //$walletsum['broker_buy_where_predict'] = $jy_jdpm_order->where($bkwhere)->where(array('status'=>array('in',array(0,1,2))))->sum('broker_buy');
		$broker_buy = pdo_fetch('select SUM(broker_buy) as broker from '. tablename('jy_jdpm_order').' where status in  ("3","10") and uniacid='.$_SESSION['uniacid']);
        $walletsum['broker_buy'] = $broker_buy['broker'];
		$broker_buy_predict = pdo_fetch('select SUM(broker_buy) as broker from '. tablename('jy_jdpm_order').' where status in  ("0","1","2") and uniacid='.$_SESSION['uniacid']);
        $walletsum['broker_buy_predict'] = $broker_buy_predict['broker'];
		$return['walletsum']=$walletsum;
//新的数据
		 //已支付订单金额
        $Price['paid'] = pdo_fetch('select SUM(price) as price from ' . tablename('jy_weishop_order'). ' where status > 0 and plugin_name = "jy_jdpm" and uniacid='.$_SESSION['uniacid']);
		$Price['paid']['price'] = price($Price['paid']['price']);
        //已过期订单金额
        $Price['stale'] = pdo_fetch('select SUM(price) as price from ' . tablename('jy_weishop_order'). ' where status = 4 and plugin_name = "jy_jdpm" and uniacid='.$_SESSION['uniacid']);
		$Price['stale']['price'] = price($Price['stale']['price']);
        //待支付订单金额
        $Price['unpaid'] = pdo_fetch('select SUM(price) as price from ' . tablename('jy_weishop_order'). ' where status = 0 and plugin_name = "jy_jdpm" and uniacid='.$_SESSION['uniacid']);
		$Price['unpaid']['price'] = price($Price['unpaid']['price']);
		$daytime = strtotime(date('Y-m-d'));
        //今日平台收入
		$todayIncome1 = pdo_fetch('select SUM(money) as money from ' . tablename('jy_jdpm_money_log'). ' where create_time > '.$daytime.' AND type = 5  and uniacid='.$_SESSION['uniacid']);
		$todayIncome2 = pdo_fetch('select SUM(money) as money from ' . tablename('jy_jdpm_money_log'). ' where create_time > '.$daytime.' AND type = 3 and mid = 0  and uniacid='.$_SESSION['uniacid']);
		//$todayIncome2 = pdo_fetch('select SUM(money) as money from ' . tablename('jy_jdpm_member_pledge_take'). ' where time > '.$daytime.' ');
		$Price['todayIncome'] = $todayIncome1['money'] +$todayIncome2['money'];
		
		 //平台收入
		$Income1 = pdo_getsum('jy_jdpm_money_log',array('type' => 5,'uniacid'=>$_SESSION['uniacid']),'money');
		$Income1 = pdo_getsum('jy_jdpm_money_log',array('type' => 3,'mid'=>0,'uniacid'=>$_SESSION['uniacid']),'money');		
		
		//$todayIncome2 = pdo_fetch('select SUM(money) as money from ' . tablename('jy_jdpm_member_pledge_take'). ' where time > '.$daytime.' ');
		$Price['Income'] = $Income1['money'] +$Income2['money'];
		$Price['Income'] = price($Price['Income']);
        //今日充值总额
		$Price['todayRecharge'] = pdo_fetch('select SUM(money) as money from ' . tablename('jy_jdpm_money_log'). ' where create_time > '.$daytime.' AND type = 0 and uniacid='.$_SESSION['uniacid']);
		$Price['todayRecharge']['money'] = price($Price['todayRecharge']['money']);
        //平台余额总额
		$Price['balanceTotal'] = pdo_fetch('select SUM(wallet_pledge) as wallet_pledge from ' . tablename('jy_jdpm_member').' where uniacid='.$_SESSION['uniacid']);
		
        //平台冻结余额总额
		$Price['freezeTotal'] = pdo_fetch('select SUM(wallet_pledge_freeze) as wallet_pledge_freeze from ' . tablename('jy_jdpm_member'). ' where uniacid='.$_SESSION['uniacid']);
		
        //平台可用余额总额
        $Price['usableTotal'] = price($credit2sum - $Price['freezeTotal']['wallet_pledge_freeze']);
		$Price['balanceTotal']['wallet_pledge'] = price($Price['balanceTotal']['wallet_pledge']);
		$Price['freezeTotal']['wallet_pledge_freeze'] = price($Price['freezeTotal']['wallet_pledge_freeze']);
		
        //拍品冻结总额
		$Price['auctionFreezeTotal'] = pdo_getsum('jy_jdpm_freezelog',array('status' =>0),'pledge');
		//$Price['auctionFreezeTotal'] = price($Price['auctionFreezeTotal']['pledge']);
        //今日提现总额
		$Price['todayWithdrawDeposit'] = pdo_fetch('select SUM(money) as money from ' . tablename('jy_jdpm_member_pledge_take'). ' where createtime > '.$daytime);
		$Price['todayWithdrawDeposit']['money'] = price($Price['todayWithdrawDeposit']['money']);
        //提现冻结总额
		$WithdrawDepositFreeze1 = pdo_fetch('select SUM(money) as money from ' . tablename('jy_jdpm_member_pledge_take'). ' where status =0 and uniacid='.$_SESSION['uniacid']);
        $WithdrawDepositFreeze2 = pdo_fetch('select SUM(mission) as mission from ' . tablename('jy_jdpm_member_pledge_take'). ' where status =0 and uniacid='.$_SESSION['uniacid']);
		$Price['WithdrawDepositFreeze'] = price($WithdrawDepositFreeze1['money'] + $WithdrawDepositFreeze2['mission']);
		$Price['auctionFreezeTotal'] -= $Price['WithdrawDepositFreeze'];
		$return['Price']=$Price;
	$return['export_auctionFreeze']=download_url('jy_jdpm/index/export_auctionFreeze');
	$return['export_WithdrawDepositFreeze']=download_url('jy_jdpm/index/export_WithdrawDepositFreeze');
	$return['export_todayRecharge']=download_url('jy_jdpm/index/export_todayRecharge');
	$return['export_todayWithdrawDeposit']=download_url('jy_jdpm/index/export_todayWithdrawDeposit');
	$data1=array(
		array('title'=>'已支付订单金额','data'=>'￥'.$Price['paid']['price']),
		array('title'=>'已过期订单金额','data'=>'￥'.$Price['stale']['price']),
		array('title'=>'待支付订单金额','data'=>'￥'.$Price['unpaid']['price']),
	);
	$data2=array(
		array('title'=>'平台收入','data'=>'￥'.$Price['Income']),
		array('title'=>'平台余额总额','data'=>'￥'.$Price['balanceTotal']['wallet_pledge']),
		array('title'=>'平台冻结金额总额','data'=>'￥'.$Price['freezeTotal']['wallet_pledge_freeze']),
		array('title'=>'平台可用余额总额','data'=>'￥'.$Price['usableTotal']),
	);
	$data3=array(
		array('title'=>'拍品冻结总额','export'=>$return['export_auctionFreeze'],'data'=>'￥'.$Price['auctionFreezeTotal']),
		array('title'=>'提现冻结总额','export'=>$return['export_WithdrawDepositFreeze'],'data'=>'￥'.$Price['WithdrawDepositFreeze']),
		array('title'=>'今日充值总额','export'=>$return['export_todayRecharge'],'data'=>'￥'.$Price['todayRecharge']['money']),
		array('title'=>'今日提现总额','export'=>$return['export_todayWithdrawDeposit'],'data'=>'￥'.$Price['todayWithdrawDeposit']['money']),
	);
	$data4=array(
		array('name'=>'平台余额总额','value'=>$Price['balanceTotal']['wallet_pledge']),
		array('name'=>'平台冻结金额总额','value'=>$Price['freezeTotal']['wallet_pledge_freeze']),
		array('name'=>'平台可用余额总额','value'=>$Price['usableTotal']),
	);
	$data5=array(
		array('name'=>'拍品冻结总额','value'=>$Price['auctionFreezeTotal']),
		array('name'=>'提现冻结总额','value'=>$Price['WithdrawDepositFreeze']),
		array('name'=>'今日充值总额','value'=>$Price['todayRecharge']['money']),
		array('name'=>'今日提现总额','value'=>$Price['todayWithdrawDeposit']['money']),
	);
	$return['htmls']=array(
		array('type'=>'data','one_num'=>4,'title'=>'累积交易额','datas'=>$data1),
		array('type'=>'data','one_num'=>3,'title'=>'平台财务数据','datas'=>$data2),
		array('type'=>'data','one_num'=>3,'title'=>'用户冻结提现数据','datas'=>$data3),
		array('type'=>'echarts_pie','one_num'=>2,'width'=>'50%','ecid'=>'wechat','title'=>'平台财务数据','datas'=>array(
			'time' => date("Y-m-d H:i:s", time()),
			'datas'=>$data4,
		)),
		array('type'=>'echarts_pie','one_num'=>2,'width'=>'50%','ecid'=>'wxapp','title'=>'用户冻结提现数据','datas'=>array(
			'time' => date("Y-m-d H:i:s", time()),
			'datas'=>$data5,
		)),
	);
	exi($return);
}
if($_RQ['op']=='export_auctionFreeze'){
	//导出拍品冻结数据
	$list=pdo_getall('jy_jdpm_freezelog',array('uniacid'=>$_SESSION['uniacid'],'status'=>0 ),array(),'','createtime asc');
	if($list){
		$types=array(
			'p-u'=>'拍品-用户',
			'g-u'=>'商品-用户',
			's-u'=>'专场-用户',
		);
		foreach($list as &$item){
			$item['g-u']=$types[$item['g-u']];
			$item['createtime']=date('Y/m/d H:i:s',$item['createtime']);
		}
	}
	$header=array(
		'mid'=>'用户ID',
		'pid'=>'拍卖ID',
		'goodsid'=>'商品ID',
		'limsum'=>'冻结信用额度',
		'pledge'=>'保证金',
		'g-u'=>'类型',
		'createtime'=>'时间',
	);
	cfc('tools')->export2excel($header,$list,'拍品冻结数据');
}
if($_RQ['op']=='export_WithdrawDepositFreeze'){
	//导出体现冻结数据
	$list=pdo_getall('jy_jdpm_member_pledge_take',array('uniacid'=>$_SESSION['uniacid'],'status'=>0),array(),'','time asc');
	if($list){
		$status=array(
			'0'=>'等待退款',
			'1'=>'已退款',
			'2'=>'已驳回',
		);
		foreach($list as &$item){
			$item['status']=$status[$item['status']];
			$item['createtime']=date('Y/m/d H:i:s',$item['createtime']);
		}
	}
	$header=array(
		'mid'=>'提现用户ID',
		'money'=>'金额',
		'bank'=>'银行',
		'bankhome'=>'开户行',
		'wechat'=>'微信',
		'alipay'=>'支付宝',
		'name'=>'提现人姓名',
		'account'=>'账号',
		'remark'=>'备注',
		'createtime'=>'提现申请时间',
		'status'=>'状态',
		'dtime'=>'处理时间',
		'mission'=>'手续费',
	);
	cfc('tools')->export2excel($header,$list,'提现数据');
}
if($_RQ['op']=='export_todayRecharge'){
	//导出今日充值数据
	$daytime = strtotime(date('Y-m-d'));
	$list=pdo_getall('jy_jdpm_money_log',array('uniacid'=>$_SESSION['uniacid'],'create_time >'=>$daytime,'type'=>0,'mid >'=>0),array(),'','create_time asc');
	if($list){
		foreach($list as &$item){
			$item['create_time']=date('Y/m/d H:i:s',$item['create_time']);
			if($item['update_time']){
				$item['update_time']=date('Y/m/d H:i:s',$item['update_time']);
			}
		}
	}
	$header=array(
		'mid'=>'用户ID',
		'money'=>'充值金额',
		'create_time'=>'充值时间',
		'update_time'=>'处理时间',
		'remarks'=>'备注',
		'role'=>'角色',
	);
	cfc('tools')->export2excel($header,$list,'今日充值数据');
}
if($_RQ['op']=='export_todayWithdrawDeposit'){
	//导出今日体现数据
	$daytime = strtotime(date('Y-m-d'));
	$list=pdo_getall('jy_jdpm_member_pledge_take',array('uniacid'=>$_SESSION['uniacid'],'time >'=>$daytime),array(),'','time asc');
	if($list){
		$status=array(
			'0'=>'等待退款',
			'1'=>'已退款',
			'2'=>'已驳回',
		);
		foreach($list as &$item){
			$item['status']=$status[$item['status']];
			$item['createtime']=date('Y/m/d H:i:s',$item['createtime']);
		}
	}
	$header=array(
		'mid'=>'提现用户ID',
		'money'=>'金额',
		'bank'=>'银行',
		'bankhome'=>'开户行',
		'wechat'=>'微信',
		'alipay'=>'支付宝',
		'name'=>'提现人姓名',
		'account'=>'账号',
		'remark'=>'备注',
		'createtime'=>'提现申请时间',
		'status'=>'状态',
		'dtime'=>'处理时间',
		'mission'=>'手续费',
	);
	cfc('tools')->export2excel($header,$list,'今日提现数据');
}
